/**
 * 功能:TK_ORDERS Dao类
 * 开发人员:chengd
 * 创建时间:2012/4/22 12:09:13
 */
package com.towker.frame.dao.sell;

import org.springframework.stereotype.Repository;

import com.towker.core.db.BaseDao;
import com.towker.frame.model.sell.Order;

@Repository
@SuppressWarnings("unchecked")
public class OrderDao extends BaseDao<Order, Long>
{
	@Override
	public Class getEntityClass()
	{
		return Order.class;
	}

	public String getLastOrderSN() {
		return (String)getSqlSessionTemplate().selectOne(getIbatisMapperNamespace()+".getLastOrderSN", null);
	}
	public Integer getOrderIdBySN(String order_sn) {
		Integer orderId = (Integer)getSqlSessionTemplate().selectOne(getIbatisMapperNamespace()+".getOrderIdBySN", order_sn);
		if (orderId == null) {
			return 0;
		} else {
			return orderId;
		}
	}
}